<?php

namespace app\mobile\controller;
use app\mobile\model\CaseModel;
use app\mobile\model\TypeModel;

class Mycase extends Base
{
    public function index($id = 0)
    {
        //$typeId = input('id', 0);
        //获取子栏目
        $caseTypeModel = new TypeModel();
        $typeList = $caseTypeModel->getList('case',6);

        //获取所有案例
        $caseModel = new CaseModel($id);
        $caseList = $caseModel->getList($id);
        $this->assign('caseList', $caseList); 
       
       return $this->fetch('index',[
           'caseList' =>$caseList,
           'typeList' =>$typeList,
           'typeId' => $id,
       ]);
    }
    
    public function body(){
        return $this->fetch();
    }
}
